<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head th:replace="commons/header :: #head(title='登录')"></head>
    <style type="text/css">
        #tips{
            color: white;
            margin-top: -22px;
            line-height: 22px;
            height: 22px;
            font-weight: bold;
        }
    </style>
    <script type="text/javascript" src="md5/md5.js" th:src="@{/md5/md5.js}"></script>
    <script type="text/javascript" th:inline="javascript">
        $(function(){
            console.log(11)
            $(".login").click(function(){
                var userCode = $("[name='userCode']").val();
                var pwd = $("[name='password']").val();
                if(userCode == "" || pwd == ""){
                    $("#tips").text("请填写正确信息！");
                    return;
                }
                if(userCode.length < 6 || pwd.length < 6){
                    $("#tips").text("帐号或者密码错误！");
                    return;
                }
                $.get(/*[[@{/login}]]*/,
                    {"userCode":$.md5(userCode),"pwd":$.md5(pwd)},
                    function(result){
                        if (result.status == 200) {
                            location.href = "/cmsMenu";
                        } else{
                            $("#tips").text(result.data);
                        }
                    }
                );
            });
        });

    </script>

    <body>
        <div class="main-wthree">
            <div class="container">
                <div class="sin-w3-agile">
                    <h2>登陆</h2>
                    <p id="tips"></p>
                    <form action="#" method="post">
                        <div class="username">
                            <span class="username">账号:</span>
                            <input type="text" name="userCode" class="name" placeholder="请输入账号" required="">
                            <div class="clearfix"></div>
                        </div>
                        <div class="password-agileits">
                            <span class="username">密码:</span>
                            <input type="password" name="password" class="password" placeholder="请输入密码" required="">
                            <div class="clearfix"></div>
                        </div>
                        <div class="rem-for-agile">
                            <input type="checkbox" name="remember" class="remember">记住密码<br>
                            <a href="#">忘了密码？</a><br>
                        </div>
                        <div class="login-w3">
                            <input type="button" class="login" value="登陆">
                        </div>
                        <div class="clearfix"></div>
                    </form>
                    <div class="back">
                        <!--<a href="main.html">Back to home</a>-->
                    </div>
                    <div class="footer">
                        <p>&copy; 2016 丰盛医院</p>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>